#ifndef CUSTOM_WIDGET_H
#define CUSTOM_WIDGET_H

#pragma once
#include <QWidget>
#include <QVector>
#include <QRectF>
#include <QSharedPointer>
#include <QPaintEvent>
#include <QFontMetricsF>
#include "TreeMap.h"
#include "show_followed_unit.h"

class CustomWidget : public QWidget
{
    Q_OBJECT

private:
    QVector<SqOutput> inputData;
    QSharedPointer<MTree> getRoot(const QPoint &pos) const;

public:
    explicit CustomWidget(QWidget *parent = nullptr);
    void setData(const QVector<SqOutput> &data);

protected:
    void paintEvent(QPaintEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;

signals:
    void ItemClicked(QSharedPointer<MTree> ptr);

};


#endif // CUSTOM_WIDGET_H
